# Contributor: knuxify <knuxify@gmail.com>
# Maintainer: knuxify <knuxify@gmail.com>
pkgname=strawberry
pkgver=1.0.5
pkgrel=1
pkgdesc="Strawberry Music Player"
url="https://strawberrymusicplayer.org"
arch="all"
license="GPL-3.0-or-later"
depends="gst-plugins-base gst-plugins-good qt6-qtbase-sqlite"
makedepends="
	alsa-lib-dev
	boost-dev
	chromaprint-dev
	cmake
	dbus-dev
	fftw-dev
	glib-dev
	gnutls-dev
	gst-plugins-base-dev
	gstreamer-dev
	libcdio-dev
	libgpod-dev
	libmtp-dev
	libxcb-dev
	protobuf-dev
	pulseaudio-dev
	qt6-qtbase-dev
	qt6-qttools-dev
	samurai
	sparsehash
	sqlite-dev
	taglib-dev
"
options="!check" # no test suite
subpackages="$pkgname-doc"
source="https://files.strawberrymusicplayer.org/strawberry-$pkgver.tar.xz"

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DBUILD_WITH_QT6=ON \
		$CMAKE_CROSSOPTS .
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
4c625c75855f87952b274c85b4c5b021b27e75a74d46202ab3ea0aa3c86f510bccdece583483c4ba73e4733f151feb5eac5f5ef5d9a956995979fa307fd8d911  strawberry-1.0.5.tar.xz
"
